Repository navigation
Add 3D representations of infrastructures in glTF 2.0 format - #172
Merged
Merged
Conversation
rezib
force-pushed
the
3d-infrastructure
branch
2 times, most recently
from
November 13, 2026 11:22
35c36d0 to
e155a0a
Compare
Drawer base class mixed logic required by all representations (database, drawing parameters, coloring rules) with logic specific to 2D images rendered with cairo (surfaces, Pango text labels, image coordinates). Restrict Drawer to the logic independent of the output format and move cairo and Pango specific attributes and methods, along with ImagePoint, into new Drawer2D class in base2d module, inherited by existing room and infrastructure drawers. This prepares the support of representations of other natures, starting with 3D representations of infrastructures in glTF format, which must share the database and coloring rules logic with 2D drawers without depending on cairo, Pango and images coordinates. Assisted-by: Claude Opus 5.5
Move the lookup of the infrastructure to represent in database, with the error raised when it is not found, from infrastructure drawer constructor to the base Drawer class. All representations of infrastructures, whatever their output format, start with this lookup. Sharing it in base Drawer class lets upcoming 3D drawer of infrastructures, and possibly other drawers in the future, reuse it with the same behavior and error message as existing 2D drawers. Assisted-by: Claude Opus 5.5
The selection of racks and rows to represent according to equipment_tags, discard_empty_racks and other_racks drawing parameters was duplicated in the draw() methods of infrastructure and axonometric infrastructure drawers, and the check of equipment tags was duplicated in their methods drawing equipment. Move this logic into base Drawer class, in _select_infrastructure_racks(), _part_contains_selected_equipment() and new _equipment_selected() methods, used by both 2D infrastructure drawers. Besides removing duplicated code, this ensures upcoming 3D drawer of infrastructures, and any other future representation of infrastructures, honours drawing parameters exactly as 2D drawers do, with a single place to fix or extend this selection logic. Assisted-by: Claude Opus 5.5
Move _rack_preceding_widths() method, which yields the widths of racks and empty slots before a rack in its row, from room drawer to base Drawer class, without modification. This method defines how racks are positioned in their rows, including the width assumed for empty slots. Any representation placing racks in rooms, starting with upcoming 3D representation of infrastructures, must follow the same rule to stay consistent with rooms diagrams. Sharing it in base Drawer class avoids diverging implementations. Assisted-by: Claude Opus 5.5
Move racks footprints overlap detection (polygons_overlap()) out of room drawer module and equipment overlap detection (equipment_overlap()) out of infrastructure drawer module, along with the detection of colliding equipment in a list of racks extracted from infrastructure drawer as colliding_equipment(), into new collisions module. These functions are pure geometry, independent of any rendering. Gathering them in a dedicated module lets upcoming 3D drawer of infrastructures, and future drawers or other consumers of datacenters geometry, detect collisions exactly as 2D drawers do without importing 2D drawers modules and their cairo dependency. Collisions warnings are now emitted by racksdb.drawers.collisions logger. Assisted-by: Claude Opus 5.5
Add GltfInfrastructureDrawer to represent infrastructures in 3D, in glTF JSON (gltf) and binary (glb) formats. The scene graph follows database structure (room, racks row, rack, equipment) with metadata in node extras. Rooms have textured raised floors with perforated tiles in front of racks doors. Equipment tags filtering, ghosts, other racks, coloring rules and collisions highlighting drawing parameters are honored. Assisted-by: Claude Opus 5.5
Add shared drawer_class() factory to select drawer according to entity, format and drawing parameters, used by both racksdb CLI and REST API. Assisted-by: Claude Opus 5.5
Add gltf and glb drawing formats. Assisted-by: Claude Opus 5.5
Cover glTF drawer, drawer class selection, CLI and REST API with gltf and glb formats. Assisted-by: Claude Opus 5.5
Add 2D/3D toggle in infrastructure details view. The 3D view loads the infrastructure glb representation in an interactive three.js viewer, loaded dynamically, with orbit controls, equipment highlighting and label on hover, view reset and fullscreen mode. Assisted-by: Claude Opus 5.5
Update infrastructure details page screenshot with 2D/3D toggle and add screenshot of 3D view of infrastructure in fullscreen mode, with its shadowed version. Add 3D view in overview diagrams, with screenshot embedded in SVG optimized with scour. Assisted-by: Claude Opus 5.5
rezib
force-pushed
the
3d-infrastructure
branch
from
November 13, 2026 12:52
e155a0a to
612e831
Compare
Add page about 3D representations of infrastructures with formats, supported drawing parameters, scene conventions and nodes metadata, and reference it in drawing parameters page. Assisted-by: Claude Opus 5.5
Document gltf and glb formats of draw command, their restrictions to infrastructures and incompatibility with coordinates, with an example. Assisted-by: Claude Opus 5.5
Document 2D/3D toggle in infrastructure details page and the controls of the interactive 3D view. Assisted-by: Claude Opus 5.5
Mention 3D representations of infrastructures in glTF format in diagrams section of overview page. Assisted-by: Claude Opus 5.5
Assisted-by: Claude Opus 5.5
rezib
force-pushed
the
3d-infrastructure
branch
from
November 13, 2026 13:13
612e831 to
a323400
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
RacksDB can now generate 3D representations of infrastructures in glTF 2.0 format, in JSON (
gltf) and binary (glb) variants. The infrastructure details page of the web UI shows them in an interactive viewer.Library
GltfInfrastructureDrawergenerates a scene graph that follows the database structure: room → racks row → rack → equipment.extras: category, type, tags, rack, slot, size, and the selected and colliding flags.KHR_texture_transform, somercury.glbis about 105 KB.equipment_tags,ghost_unselected,discard_empty_racks,other_racksCLI and REST API
racksdb draw infrastructure --format gltf|glb./draw/infrastructure/<name>.gltf|glbendpoint returnsmodel/gltf+json/model/gltf-binary.drawer_class()factory used by both the CLI and the REST API.Web UI
Refactoring
Before the feature, a few preparatory refactors, one commit each:
Drawerinto a format-independentDrawerand a cairo/PangoDrawer2D.Drawer. This also removes the racks selection code duplicated between the flat and axonometric drawers.collisionsmodule. Collision warnings are now emitted by theracksdb.drawers.collisionslogger.Docs
racksdbmanpage, web UI page and OpenAPI description updated.Testing
Closes #164